import 'vant/lib/index.css'
import './assets/css/main.scss'
import './assets/css/theme.scss'
import './assets/css/vant.scss'
import './assets/css/echarts.scss'
import 'element-plus/dist/index.css'

import './config/vant'
import './utils/cacheScroll'
import './utils/vconsole'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { UploadFilled } from '@element-plus/icons-vue'
import piniaStorage from 'pinia-plugin-persistedstate'

import App from './App.vue'
import router from './router'

const app = createApp(App)

app.component('UploadFilled', UploadFilled)

/** 挂载到vue实例上的全局属性，可以在<template>中直接使用 */
const globalProperties = {
  __ENV__,
  pxToVw,
  pxToPX,
  getChartTextRect,
  useDirectiveFunction,
  hasDirectiveFunction,
  scrollToView,
  isNumeric,
  stringToNumber,
  isLessThan,
  backRedirectTo,
}
Object.assign(app.config.globalProperties, globalProperties)
declare module 'vue' {
  type GlobalProperties = typeof globalProperties
  interface ComponentCustomProperties extends GlobalProperties {}
}

const store = createPinia()
store.use(piniaStorage)
app.use(store)
app.use(router)

app.mount('#app')
